<?php global $file,$section; ?>
<div class="subnavbar">
  <div class="subnavbar-inner">
    <div class="container">
      <ul class="mainnav">
        <li <?php if($file=="dashboard") {echo " class=\"active\" ";} ?> >
			<a href="dashboard.php">
				<i class="icon-dashboard"></i><span>Dashboard</span> 
			</a> 
		</li>
        <li <?php if($file=="motors") {echo " class=\"active\" ";} ?> >
			<a href="motors.php">
				<i class="icon-list-alt"></i><span>Motors</span> 
			</a> 
		</li>
		<li <?php if($file=="addMotor") {echo " class=\"active\" ";} ?> >
			<a href="addMotor.php">
				<i class="icon-plus-sign"></i><span>Add Motor</span> 
			</a> 
		</li>
		<li <?php if($file=="swapMotor") {echo " class=\"active\" ";} ?> >
			<a href="swapMotor.php">
				<i class="icon-tasks"></i><span>Swap Motor</span> 
			</a> 
		</li>
		<li <?php if($file=="reports") {echo " class=\"active\" ";} ?> >
			<a href="reports.php">
				<i class="icon-book"></i><span>Reports</span> 
			</a> 
		</li>
		<li <?php if($file=="faq") {echo " class=\"active\" ";} ?> >
			<a href="faq.php">
				<i class="icon-question-sign"></i><span>FAQ</span> 
			</a> 
		</li>
		<?php
			$userType=isset($userId) && $entityId ? Users::getUserType($userId,$entityId) : NULL ;
			$class="";
			if($userType=="admin"){
				if($file=="adminPanel"){
					$class="active";
				}
					echo '
						<li class="dropdown '.$class.' subnavbar-open-right">					
							<a data-toggle="dropdown" class="dropdown-toggle" href="javascript:;">
								<i class="icon-sitemap"></i>
								<span>Admin Panel</span>
								<b class="caret"></b>
							</a>	

							<ul class="dropdown-menu {$class}">
								<li><a href="adminPanel.php?sub=addUser">Add User</a></li>
								<li><a href="adminPanel.php?sub=editUser">Edit User</a></li>
							</ul>    				
						</li>
					';
			}
		?>
      </ul>
    </div>
    <!-- /container --> 
  </div>
  <!-- /subnavbar-inner --> 
</div>
<!-- /subnavbar -->

